package com.zhengbing.tj.design.chain;

/**
 * 责任链模式Demo测试入口
 *
 * @author zhengbing
 * @date 2025-07-21
 */
public class ChainDemoMain {
    public static void main(String[] args) {
        Handler h1 = new FirstHandler();
        Handler h2 = new SecondHandler();
        Handler h3 = new ThirdHandler();
        h1.setNext(h2).setNext(h3);

        System.out.println("--- 测试请求A ---");
        h1.handle("请求A");

        System.out.println("\n--- 测试请求B ---");
        h1.handle("请求B");

        System.out.println("\n--- 测试请求C ---");
        h1.handle("请求C");

        System.out.println("\n--- 测试请求X ---");
        h1.handle("请求X");
    }
} 